default: build

CC=gcc

build: build-demo 

build-demo:
	@echo "Building..."
	$(CC) -o bin/demo demo.c  -I. -I./lib/libch9326_x64/ -L./lib/libch9326_x64 -lch9326 -L. -lopm

build-opm:
	@echo "Building..."
	$(CC) -shared -o libopm.so -fPIC opm.c -I. -I./lib/libch9326_x64/ -L./lib/libch9326_x64 -lch9326

release: build-opm
	mkdir -p release
	cp libopm.so release/libopm.so
	cp opm.h release/opm.h
	cp ./lib/libch9326_x64/ch9326.h release/ch9326.h
	cp ./lib/libch9326_x64/libch9326.so release/libch9326.so
	cp ./demo.c release/demo.c
	cp Makefile.release release/Makefile
	cp README.md.release release/README.md
	tar -zcvf release_`date  +'%Y-%m-%d-%H-%M'`.tar.gz release





clean:
	@echo "Cleaning..."
	rm -f main
